// app.js
App({
  onLaunch() {
    // 展示本地存储能力
    const logs = wx.getStorageSync('logs') || []
    logs.unshift(Date.now())
    wx.setStorageSync('logs', logs)
    wx.getSystemInfo({
      success: e => {
        let capsule = wx.getMenuButtonBoundingClientRect();
        if (capsule) {
          this.globalData.Custom = capsule;
          this.globalData.CustomBar = capsule.bottom + capsule.top - e.statusBarHeight;
        } else {
          this.globalData.CustomBar = e.statusBarHeight + 50;
        }
        }
       },
    ),
    // 登录
    wx.login({
      success: res => {
        // 发送 res.code 到后台换取 openId, sessionKey, unionId
      }
    })
  },
  onShow(){
  },
  globalData: {
    userInfo: null,
    datalist:function(){
      const data = [ {
       "pagePath": "/pages/home/home",
       "text": "商城",
       "iconPath": "../icon/商城.png",
       "selectedIconPath": "../icon/商城.png",
       show:true
     },
     {
       "pagePath": "/pages/pointsmall/pointsmall",
       "text": "积分",
       "iconPath": "../icon/积分.png",
       "selectedIconPath": "../icon/积分.png",
       show:true
     },
     {
       "pagePath": "/pages/my/my",
       "text": "我的",
       "iconPath": "../icon/我的.png",
       "selectedIconPath": "../icon/我的.png",
       show:true
     },
     {
       "pagePath": "/pages/merchanthome/merchanthome",
       "text": "工作台",
       "iconPath": "/icon/商家/商家端-导航栏-工作台x224.png",
       "selectedIconPath": "/icon/商家/商家端-导航栏-工作台x224.png",
       show:true
     },
     {
      "pagePath": "/pages/verification/verification",
      "text": "核销记录",
      "iconPath": "/icon/商家/商家端-导航栏-核销记录x224.png",
      "selectedIconPath": "/icon/商家/商家端-导航栏-核销记录x224.png",
      show:true
    },
    {
      "pagePath": "/pages/merchant/merchant",
      "text": "我的",
      "iconPath": "/icon/商家/商家端-导航栏-我的x224.png",
      "selectedIconPath": "/icon/商家/商家端-导航栏-我的x224.png",
      show:true
    }
    ]
     return data
     }
  }
})
